package cn.formal.pojo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;


@ApiModel
@Data
@AllArgsConstructor
@NoArgsConstructor
@Document(indexName = "question",type = "answers")
public class QuestionAnswer implements Serializable {

    @Id
    @ApiModelProperty("问答ID")
    private Long id;

    /*
    问题
     */
    @ApiModelProperty("问题")
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String title;

    /*
    答案
     */
    @ApiModelProperty("答案")
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String answer;

}
